/*
 * Copyright (c) 2018-2025 Tencent. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

namespace TencentCloud.Kms.V20190118.Models
{
    using Newtonsoft.Json;
    using System.Collections.Generic;
    using TencentCloud.Common;

    public class ImportDataKeyRequest : AbstractModel
    {
        
        /// <summary>
        /// Name of the data key.
        /// </summary>
        [JsonProperty("DataKeyName")]
        public string DataKeyName{ get; set; }

        /// <summary>
        /// If the imported key is plaintext data key, it is the base64 plaintext data key after conversion. if the imported key is ciphertext data key, it is the ciphertext data key generated by the KMS GenerateDataKey interface.
        /// </summary>
        [JsonProperty("ImportKeyMaterial")]
        public string ImportKeyMaterial{ get; set; }

        /// <summary>
        /// 1: ciphertext import (data key generated by KMS api) 2: plaintext import.
        /// </summary>
        [JsonProperty("ImportType")]
        public ulong? ImportType{ get; set; }

        /// <summary>
        /// Describes the data key. maximum 100 bytes.
        /// </summary>
        [JsonProperty("Description")]
        public string Description{ get; set; }

        /// <summary>
        /// When importing an encrypted data key, no need to input the root key. if the input is provided, validate whether the KeyId matches the one in the ciphertext.
        /// When importing plaintext data key, KeyId cannot be empty. the data key is encrypted with the specified root key.
        /// </summary>
        [JsonProperty("KeyId")]
        public string KeyId{ get; set; }

        /// <summary>
        /// HSM cluster ID corresponding to the KMS exclusive edition. if HsmClusterId is specified, it indicates the root key is in this cluster and verifies whether KeyId corresponds to HsmClusterId.
        /// </summary>
        [JsonProperty("HsmClusterId")]
        public string HsmClusterId{ get; set; }


        /// <summary>
        /// For internal usage only. DO NOT USE IT.
        /// </summary>
        public override void ToMap(Dictionary<string, string> map, string prefix)
        {
            this.SetParamSimple(map, prefix + "DataKeyName", this.DataKeyName);
            this.SetParamSimple(map, prefix + "ImportKeyMaterial", this.ImportKeyMaterial);
            this.SetParamSimple(map, prefix + "ImportType", this.ImportType);
            this.SetParamSimple(map, prefix + "Description", this.Description);
            this.SetParamSimple(map, prefix + "KeyId", this.KeyId);
            this.SetParamSimple(map, prefix + "HsmClusterId", this.HsmClusterId);
        }
    }
}

